<%@ page language="java"  pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/views/common/taglib.jsp" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="viewport" content="width=320.1, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <%@ include file="/WEB-INF/views/common/resource.jsp" %>
    <script>
        var ctx = '${ctx}';
    </script>
</head>
<body>
<div class="pop_bg"></div>
<div class="pop_box" id="qrtj_box">
    <img src="${ctx}/images/failed_img.png" width="40%" />
    <p>一旦下单，您将无法取消订单，请在收货时点清货物，及时付款</p>
    <p><br></p>
    <input type="button" value="知道啦" id="close" />
</div>
<div class="pop_box" id="add_box">
    <img src="${ctx}/images/failed_img.png" width="40%" />
    <p>如果现在修改收货地址，您需要重新登录下单。</p>
    <p><br></p>
    <input type="button" onclick="toEditAddress()" value="继续修改" />
    <em class="close_pop"><img src="${ctx}/images/close_icon.png" width="35" /></em>
</div>


<div class="page order pt0">
    <div class="order_detil_content">
        <div class="order_detil_infobox">
            <h1>商品清单</h1>
            <ul class="order_detil_prolist">
                <c:forEach var="list" items="${shop_car_info.goods_list}">
                    <li>
                        <c:if test="${list.goods_type eq 'GIVEAWAY'}">
                            <div class="free_info_box">
                                <em>赠</em>
                                <span>${list.goods_name}</span>
                            </div>
                        </c:if>
                        <div class="pro_img_box"><img src="${list.goods_img}" width="70" height="70" /></div>
                        <div class="pro_info_box">
                            <strong>${list.goods_name}</strong>
                            <span>¥${list.goods_price}</span>
                        </div>
                        <div class="pro_info_box bottom">
                            <em>规格：${list.goods_specifications}</em>
                            <span>X${list.goods_num}</span>
                        </div>
                    </li>
                </c:forEach>

            </ul>
            <div class="pro_total_box">
                <span>共${fn:length(shop_car_info.goods_list)}件</span>
                <span>配送费：¥0</span>
                <c:choose>
                    <c:when test="${shop_car_info.sale_type eq 'PRICE_OFF'}">
                        <strong>已减¥${shop_car_info.off_price} 总计：¥${shop_car_info.price}</strong>
                    </c:when>

                    <c:otherwise>
                        <strong>总计：¥${shop_car_info.price}</strong>
                    </c:otherwise>
                </c:choose>

            </div>
        </div>
        <div class="order_detil_infobox">
            <dl>
                <dt>支付方式</dt>
                <dd>货到付款</dd>
            </dl>
        </div>
        <div class="order_detil_infobox">
            <strong>${customer.customer_name}</strong><span>${customer.customer_mobile}</span>
            <p>
                <i class="iconfont icon-site2"></i>${customer.address}
                <a id="edit_add">修改<i class="iconfont icon-qianbi"></i></a>
            </p>
        </div>
        <div class="order_detil_infobox">
            <strong>这是3家为您推荐的送货商，请选择一家送货商为您配送
                <span>（如果您选择的经销商拒绝接单，系统将自动分配另一家优质供销商为您送货）</span>：</strong>
            <div class="dealer_info_box">
                <c:set var="a" value="1"></c:set>
                <c:forEach items="${mep_list}"  var="mep">
                    <c:choose>
                        <c:when test="${a>3}">
                            <p class="other_mep" style="display: none">
                        </c:when>
                        <c:otherwise>
                            <p>
                        </c:otherwise>
                    </c:choose>
                        <label>
                            <input type="radio" value="${mep.mep_no}" name="add" />
                            <span>${mep.mep_name}</span>
                            ${mep.address}
                        </label>
                    </p>
                    <c:set var="a" value="${a+1}"></c:set>
                </c:forEach>

                <a style="position: static; display: block; text-align: center; margin-top: 10px;" onclick="showMep(this)">更多经销商</a>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="bottom_btns" id="qrtj" onclick="createOrder()">确认提交</div>
</div>

<script type="text/javascript">
    var orderJson = '${shop_car_info_json}';

    function showMep(obj) {
        $('.other_mep').show();
        $(obj).hide();
    }

    $('.pop_bg').click(function(e){
        $('.pop_bg').hide();
        $('.pop_box').hide();
    });

    $('#close').click(function(e){
        $('.pop_bg').hide();
        $('.pop_box').hide();
    });

    $('.close_pop').click(function(e){
        $('.pop_bg').hide();
        $('.pop_box').hide();
    });

//    $('#qrtj').click(function(e){
//        $('.pop_bg').height($(document).height());
//        $('.pop_bg').show();
//        $('#qrtj_box').show();
//    });

    $('#edit_add').click(function(e){
        $('.pop_bg').height($(document).height());
        $('.pop_bg').show();
        $('#add_box').show();
    })
</script>

<script src="${rtx}/js/orderCreate.js"></script>
</body>
</html>
